
<div id="slides" <?php if($access->isLoggedin()) {?> style="margin-top: 30px;"<?php }?>>
	<a href="#" class="prev"><img src="assets/slidesjs/img/arrow-prev.png" width="24" height="43" alt="Arrow Prev"></a>
	<a href="#" class="next"><img src="assets/slidesjs/img/arrow-next.png" width="24" height="43" alt="Arrow Next"></a>
	<div class="slides_container">
	<?php foreach($subjects as $subject){
        $thumbnail = $this->PhpThumb->generate(
                                array(
                                    'save_path' => WWW_ROOT . 'img/uploads/Subjects/thumbs',
                                    // Where to save the thumbnail. (Make sure it is writable by the web server)

                                    'display_path' => 'uploads/Subjects/thumbs',
                                    // The web accessible path to the directory that the thumbnail lives in after its created.

                                    'error_image_path' => 'img/error.jpg',
                                    // The default image to display if something goes wrong while generating a thumbnail. 

                                    'src' => WWW_ROOT . "img/uploads/Subjects/" . $subject['Subject']['image'],
                                    // The source image to be converted into a thumbnail.
                                    // From here on out, you can pass any standard phpThumb parameters

                                    'w' => 199,
                                    'h' => 199,
                                    'q' => 100,
                                    'zc' => 1
                                    //'fltr'=>array('ric|4|4')
                                )
                        );
        if($thumbnail['error'] == 1)
        {
            continue;
        }
    ?>
		<div class="slide">
			<ul>
				<li class=col1>
					<?php echo $this->Html->image($thumbnail['src'], array('width' => $thumbnail['w'], 'height' => $thumbnail['h'],'title'=>$subject['Subject']['subject'],'alt'=>$subject['Subject']['subject'])); ?>
				</li>
				<li class=col2>
					<form action="" method="get">
                    <?php if($access->isLoggedin()) { ?>
                    <button rateit type="submit" class="rateit" value="<?php echo $subject['Subject']['id'] ?>" onclick="return false;"><?php __('rate it'); ?></button>
                    <?php }else { ?>
					<button rateit type="submit" onclick="showLoginRegister(false); return false;" ><?php __('rate it'); ?></button>
                    <?php } ?>
				
					<h1><?php __('How much do you like?'); ?>
						<small>
                        <?php 
                            echo $subject['Subject']['subject'];
                            /*if(!empty($subject['Subject']['desc']))
                            {
                                echo " (".$subject['Subject']['desc'] ." )";
                            }*/
                        ?>
                        </small>
					</h1>
					
					<div class="slider-range-min">
						<ul>
							<li class=col1>hate</li>
							<li class=col2>love</li>
						</ul>
					</div>
					<input type="text" class="rates" name="rates" id="rates" readonly>
					</form>
				</li>
			</ul>
			<a skip href="<?php echo $this->base ?>/subjects/subject/<?php echo $subject['Subject']['id']; ?>" class="skip">skip rating</a>
		</div>
    <?php } ?>
	</div>
</div>

<div id=wrapthumbs>
<a class="prevPage browse left"></a> 

	<!-- root element for scrollable --> 
	<div class="scrollable">     
	     
	    <ul class="items"> 
	    	<?php foreach($mostrated as $object){
                $thumbnail = $this->PhpThumb->generate(
                                        array(
                                            'save_path' => WWW_ROOT . 'img/uploads/Subjects/thumbs',
                                            // Where to save the thumbnail. (Make sure it is writable by the web server)
        
                                            'display_path' => 'uploads/Subjects/thumbs',
                                            // The web accessible path to the directory that the thumbnail lives in after its created.
        
                                            'error_image_path' => 'img/error.jpg',
                                            // The default image to display if something goes wrong while generating a thumbnail. 
        
                                            'src' => WWW_ROOT . "img/uploads/Subjects/" . $object['Subject']['image'],
                                            // The source image to be converted into a thumbnail.
                                            // From here on out, you can pass any standard phpThumb parameters
        
                                            'w' => 40,
                                            'h' => 40,
                                            'q' => 100,
                                            'zc' => 1
                                            //'fltr'=>array('ric|4|4')
                                        )
                                );
                if($thumbnail['error'] == 1)
                {
                    continue;
                }
            ?>
	    	<li><a href="<?php echo $this->base ?>/subjects/subject/<?php echo $object['Subject']['id'] ?>"><?php echo $this->Html->image($thumbnail['src'], array('width' => $thumbnail['w'], 'height' => $thumbnail['h'],'title'=>$object['Subject']['subject'],'alt'=>$object['Subject']['subject'])); ?></a></li>
        <?php } ?>
	    </ul> 
	</div> 
 
<a class="nextPage browse right"></a>
</div>

<div id=wrapuniverse>
	<ul>
		<li id=universal_search class=col1>
			<form action="<?php echo $this->base ?>/subjects/search/" method="post">
				<label for="subject">search the universe</label>
				<select name="search_type" class="search_type">
					<option value="0">Subjects</option>
					<option value="1">Tags</option>
				</select>
				<input type="search" name="subject" placeholder="Type Keyword">
				<button type="submit"> &nbsp; </button>
			</form>
		</li>
		<li id=universal_tag class='col2 right'>
			<a href="<?php echo $this->base ?>/tags/tag_tree"><img src="assets/images/icon_searchtag.png" alt="icon_searchtag" width="64" /></a> search tag tree
		</li>
	</ul>
</div>